package com.huidu.bitrade.vo;

import com.alibaba.fastjson2.JSON;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;

@Data
public class MemberLoanVO {

    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @ApiModelProperty("用户ID")
    private Long memberId;

    @ApiModelProperty("金额")
    private BigDecimal money;

    @ApiModelProperty("数量")
    private BigDecimal number;

    @ApiModelProperty("币种")
    private String baseCoinSymbol;

    @ApiModelProperty("状态 1审核中 2待赎回 3已赎回 4拒绝")
    private Integer status;

    @ApiModelProperty("拒绝原因")
    private String reason;

    @ApiModelProperty("结束时间")
    private Long endDate;

    @ApiModelProperty("支付方式 1支付宝 2微信 3银行卡")
    private Integer payType;

    @JsonIgnore
    @ApiModelProperty(hidden = true)
    private String payInfo;

    @ApiModelProperty("支付信息")
    private MemberAccountVO memberAccountVO;

    private Long createUser;

    private Long updateUser;

    private Long createTime;

    private Long updateTime;

    public void setPayInfo(String payInfo) {
        this.memberAccountVO = JSON.parseObject(payInfo,MemberAccountVO.class);
        this.payInfo = payInfo;
    }
}
